3.9.96 \(\int (a+i a \tan (e+f x))^4 (c-i c \tan (e+f x))^2 \, dx\) [896]

Optimal. Leaf size=58 \[ -\frac {i c^2 (a+i a \tan (e+f x))^4}{2 f}+\frac {i c^2 (a+i a \tan (e+f x))^5}{5 a f} \]

[Out]

-1/2*I*c^2*(a+I*a*tan(f*x+e))^4/f+1/5*I*c^2*(a+I*a*tan(f*x+e))^5/a/f

________________________________________________________________________________________

Rubi [A]
time = 0.07, antiderivative size = 58, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 31, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.097, Rules used = {3603, 3568, 45} \begin {gather*} \frac {i c^2 (a+i a \tan (e+f x))^5}{5 a f}-\frac {i c^2 (a+i a \tan (e+f x))^4}{2 f} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(a + I*a*Tan[e + f*x])^4*(c - I*c*Tan[e + f*x])^2,x]

[Out]

((-1/2*I)*c^2*(a + I*a*Tan[e + f*x])^4)/f + ((I/5)*c^2*(a + I*a*Tan[e + f*x])^5)/(a*f)

Rule 45

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rule 3568

Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Dist[1/(a^(m - 2)*b
*f), Subst[Int[(a - x)^(m/2 - 1)*(a + x)^(n + m/2 - 1), x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b, e, f, n}, x
] && EqQ[a^2 + b^2, 0] && IntegerQ[m/2]

Rule 3603

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((c_) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Di
st[a^m*c^m, Int[Sec[e + f*x]^(2*m)*(c + d*Tan[e + f*x])^(n - m), x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] &&
EqQ[b*c + a*d, 0] && EqQ[a^2 + b^2, 0] && IntegerQ[m] &&  !(IGtQ[n, 0] && (LtQ[m, 0] || GtQ[m, n]))

Rubi steps

\begin {align*} \int (a+i a \tan (e+f x))^4 (c-i c \tan (e+f x))^2 \, dx &=\left (a^2 c^2\right ) \int \sec ^4(e+f x) (a+i a \tan (e+f x))^2 \, dx\\ &=-\frac {\left (i c^2\right ) \text {Subst}\left (\int (a-x) (a+x)^3 \, dx,x,i a \tan (e+f x)\right )}{a f}\\ &=-\frac {\left (i c^2\right ) \text {Subst}\left (\int \left (2 a (a+x)^3-(a+x)^4\right ) \, dx,x,i a \tan (e+f x)\right )}{a f}\\ &=-\frac {i c^2 (a+i a \tan (e+f x))^4}{2 f}+\frac {i c^2 (a+i a \tan (e+f x))^5}{5 a f}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 1.13, size = 80, normalized size = 1.38 \begin {gather*} \frac {a^4 c^2 \sec (e) \sec ^5(e+f x) (5 i \cos (f x)+5 i \cos (2 e+f x)+5 \sin (f x)-5 \sin (2 e+f x)+5 \sin (2 e+3 f x)+\sin (4 e+5 f x))}{20 f} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(a + I*a*Tan[e + f*x])^4*(c - I*c*Tan[e + f*x])^2,x]

[Out]

(a^4*c^2*Sec[e]*Sec[e + f*x]^5*((5*I)*Cos[f*x] + (5*I)*Cos[2*e + f*x] + 5*Sin[f*x] - 5*Sin[2*e + f*x] + 5*Sin[
2*e + 3*f*x] + Sin[4*e + 5*f*x]))/(20*f)

________________________________________________________________________________________

Maple [A]
time = 0.08, size = 50, normalized size = 0.86

method result size
derivativedivides \(\frac {a^{4} c^{2} \left (\tan \left (f x +e \right )-\frac {\left (\tan ^{5}\left (f x +e \right )\right )}{5}+\frac {i \left (\tan ^{4}\left (f x +e \right )\right )}{2}+i \left (\tan ^{2}\left (f x +e \right )\right )\right )}{f}\) \(50\)
default \(\frac {a^{4} c^{2} \left (\tan \left (f x +e \right )-\frac {\left (\tan ^{5}\left (f x +e \right )\right )}{5}+\frac {i \left (\tan ^{4}\left (f x +e \right )\right )}{2}+i \left (\tan ^{2}\left (f x +e \right )\right )\right )}{f}\) \(50\)
risch \(\frac {8 i a^{4} c^{2} \left (10 \,{\mathrm e}^{6 i \left (f x +e \right )}+10 \,{\mathrm e}^{4 i \left (f x +e \right )}+5 \,{\mathrm e}^{2 i \left (f x +e \right )}+1\right )}{5 f \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )^{5}}\) \(61\)
norman \(\frac {a^{4} c^{2} \tan \left (f x +e \right )}{f}+\frac {i a^{4} c^{2} \left (\tan ^{2}\left (f x +e \right )\right )}{f}-\frac {a^{4} c^{2} \left (\tan ^{5}\left (f x +e \right )\right )}{5 f}+\frac {i a^{4} c^{2} \left (\tan ^{4}\left (f x +e \right )\right )}{2 f}\) \(77\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+I*a*tan(f*x+e))^4*(c-I*c*tan(f*x+e))^2,x,method=_RETURNVERBOSE)

[Out]

1/f*a^4*c^2*(tan(f*x+e)-1/5*tan(f*x+e)^5+1/2*I*tan(f*x+e)^4+I*tan(f*x+e)^2)

________________________________________________________________________________________

Maxima [A]
time = 0.49, size = 72, normalized size = 1.24 \begin {gather*} -\frac {2 \, a^{4} c^{2} \tan \left (f x + e\right )^{5} - 5 i \, a^{4} c^{2} \tan \left (f x + e\right )^{4} - 10 i \, a^{4} c^{2} \tan \left (f x + e\right )^{2} - 10 \, a^{4} c^{2} \tan \left (f x + e\right )}{10 \, f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))^4*(c-I*c*tan(f*x+e))^2,x, algorithm="maxima")

[Out]

-1/10*(2*a^4*c^2*tan(f*x + e)^5 - 5*I*a^4*c^2*tan(f*x + e)^4 - 10*I*a^4*c^2*tan(f*x + e)^2 - 10*a^4*c^2*tan(f*
x + e))/f

________________________________________________________________________________________

Fricas [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 133 vs. \(2 (48) = 96\).
time = 1.19, size = 133, normalized size = 2.29 \begin {gather*} -\frac {8 \, {\left (-10 i \, a^{4} c^{2} e^{\left (6 i \, f x + 6 i \, e\right )} - 10 i \, a^{4} c^{2} e^{\left (4 i \, f x + 4 i \, e\right )} - 5 i \, a^{4} c^{2} e^{\left (2 i \, f x + 2 i \, e\right )} - i \, a^{4} c^{2}\right )}}{5 \, {\left (f e^{\left (10 i \, f x + 10 i \, e\right )} + 5 \, f e^{\left (8 i \, f x + 8 i \, e\right )} + 10 \, f e^{\left (6 i \, f x + 6 i \, e\right )} + 10 \, f e^{\left (4 i \, f x + 4 i \, e\right )} + 5 \, f e^{\left (2 i \, f x + 2 i \, e\right )} + f\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))^4*(c-I*c*tan(f*x+e))^2,x, algorithm="fricas")

[Out]

-8/5*(-10*I*a^4*c^2*e^(6*I*f*x + 6*I*e) - 10*I*a^4*c^2*e^(4*I*f*x + 4*I*e) - 5*I*a^4*c^2*e^(2*I*f*x + 2*I*e) -
 I*a^4*c^2)/(f*e^(10*I*f*x + 10*I*e) + 5*f*e^(8*I*f*x + 8*I*e) + 10*f*e^(6*I*f*x + 6*I*e) + 10*f*e^(4*I*f*x +
4*I*e) + 5*f*e^(2*I*f*x + 2*I*e) + f)

________________________________________________________________________________________

Sympy [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 182 vs. \(2 (44) = 88\).
time = 0.32, size = 182, normalized size = 3.14 \begin {gather*} \frac {80 i a^{4} c^{2} e^{6 i e} e^{6 i f x} + 80 i a^{4} c^{2} e^{4 i e} e^{4 i f x} + 40 i a^{4} c^{2} e^{2 i e} e^{2 i f x} + 8 i a^{4} c^{2}}{5 f e^{10 i e} e^{10 i f x} + 25 f e^{8 i e} e^{8 i f x} + 50 f e^{6 i e} e^{6 i f x} + 50 f e^{4 i e} e^{4 i f x} + 25 f e^{2 i e} e^{2 i f x} + 5 f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))**4*(c-I*c*tan(f*x+e))**2,x)

[Out]

(80*I*a**4*c**2*exp(6*I*e)*exp(6*I*f*x) + 80*I*a**4*c**2*exp(4*I*e)*exp(4*I*f*x) + 40*I*a**4*c**2*exp(2*I*e)*e
xp(2*I*f*x) + 8*I*a**4*c**2)/(5*f*exp(10*I*e)*exp(10*I*f*x) + 25*f*exp(8*I*e)*exp(8*I*f*x) + 50*f*exp(6*I*e)*e
xp(6*I*f*x) + 50*f*exp(4*I*e)*exp(4*I*f*x) + 25*f*exp(2*I*e)*exp(2*I*f*x) + 5*f)

________________________________________________________________________________________

Giac [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 133 vs. \(2 (48) = 96\).
time = 0.71, size = 133, normalized size = 2.29 \begin {gather*} -\frac {8 \, {\left (-10 i \, a^{4} c^{2} e^{\left (6 i \, f x + 6 i \, e\right )} - 10 i \, a^{4} c^{2} e^{\left (4 i \, f x + 4 i \, e\right )} - 5 i \, a^{4} c^{2} e^{\left (2 i \, f x + 2 i \, e\right )} - i \, a^{4} c^{2}\right )}}{5 \, {\left (f e^{\left (10 i \, f x + 10 i \, e\right )} + 5 \, f e^{\left (8 i \, f x + 8 i \, e\right )} + 10 \, f e^{\left (6 i \, f x + 6 i \, e\right )} + 10 \, f e^{\left (4 i \, f x + 4 i \, e\right )} + 5 \, f e^{\left (2 i \, f x + 2 i \, e\right )} + f\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))^4*(c-I*c*tan(f*x+e))^2,x, algorithm="giac")

[Out]

-8/5*(-10*I*a^4*c^2*e^(6*I*f*x + 6*I*e) - 10*I*a^4*c^2*e^(4*I*f*x + 4*I*e) - 5*I*a^4*c^2*e^(2*I*f*x + 2*I*e) -
 I*a^4*c^2)/(f*e^(10*I*f*x + 10*I*e) + 5*f*e^(8*I*f*x + 8*I*e) + 10*f*e^(6*I*f*x + 6*I*e) + 10*f*e^(4*I*f*x +
4*I*e) + 5*f*e^(2*I*f*x + 2*I*e) + f)

________________________________________________________________________________________

Mupad [B]
time = 4.80, size = 80, normalized size = 1.38 \begin {gather*} \frac {a^4\,c^2\,\sin \left (e+f\,x\right )\,\left (10\,{\cos \left (e+f\,x\right )}^4+{\cos \left (e+f\,x\right )}^3\,\sin \left (e+f\,x\right )\,10{}\mathrm {i}+\cos \left (e+f\,x\right )\,{\sin \left (e+f\,x\right )}^3\,5{}\mathrm {i}-2\,{\sin \left (e+f\,x\right )}^4\right )}{10\,f\,{\cos \left (e+f\,x\right )}^5} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + a*tan(e + f*x)*1i)^4*(c - c*tan(e + f*x)*1i)^2,x)

[Out]

(a^4*c^2*sin(e + f*x)*(cos(e + f*x)*sin(e + f*x)^3*5i + cos(e + f*x)^3*sin(e + f*x)*10i + 10*cos(e + f*x)^4 -
2*sin(e + f*x)^4))/(10*f*cos(e + f*x)^5)

________________________________________________________________________________________